import request from "../request";


//获取员工列表
const getSchoolList = async (page: number) => {
    return await request.get('/api/campus/getSysCampusPage?page=' + page, { showLoading: false })
}

//新增校区
const addSchoole = async (params:any) => {
    return await request.post('/api/campus/addSysCampusName',JSON.stringify(params),{showLoading:true})
}

// 获取专栏
const addCategory = async (params:any) => {
    return await request.post8089('/api/admin/addCategory',JSON.stringify(params),{showLoading:true})
}
const updateCategory = async (params:any) => {
    return await request.post8089('/api/admin/updateCategory',JSON.stringify(params),{showLoading:true})
}
const deleteCategory = async (params:any) => {
    return await request.post8089('/api/admin/deleteCategory',JSON.stringify(params),{showLoading:true})
}
const getCategory = async (params:any) => {
    return await request.post8089('/api/admin/getCategory',JSON.stringify(params),{showLoading:true})
}

// 获取题目
const getSubject = async (params:any) => {
    return await request.post8089('/api/admin/getSubject',JSON.stringify(params), { showLoading: false })
}
const deleteSubject = async (params:any) => {
    return await request.post8089('/api/admin/deleteSubject',JSON.stringify(params), { showLoading: false })
}
const updateSubject = async (params:any) => {
    return await request.post8089('/api/admin/updateSubject',JSON.stringify(params), { showLoading: false })
}
const addSubject = async (params:any) => {
    return await request.post8089('/api/admin/addSubject',JSON.stringify(params), { showLoading: false })
}

// 答题记录
const getUserAnswerRecord = async (params:any) => {
    return await request.post8089('/api/admin/getUserAnswerRecord',JSON.stringify(params), { showLoading: false })
}
const getAnswerRank = async (params:any) => {
    return await request.post8089('/api/applet/getAnswerRank',JSON.stringify(params), { showLoading: false })
}

//修改校区
const editSchoole = async (params:any) => {
    return await request.post('/api/campus/changeSysCampusIsDeleteById',JSON.stringify(params),{showLoading:true})
}

// 趣味小知识
const getKnowledge = async (params:any) => {
    return await request.post18089('/api/admin/getLittleKnowledge',JSON.stringify(params),{showLoading:false})
}
const addKnowledge = async (params:any) => {
    return await request.post18089('/api/admin/addLittleKnowledge',JSON.stringify(params),{showLoading:false})
}
const deleteKnowledge = async (params:any) => {
    return await request.post18089('/api/admin/deleteLittleKnowledge',JSON.stringify(params),{showLoading:false})
}
const editKnowledge = async (params:any) => {
    return await request.post18089('/api/admin/updateLittleKnowledge',JSON.stringify(params),{showLoading:false})
}


export {
    getSchoolList,
    addSchoole,
    editSchoole,
    addCategory,
    updateCategory,
    deleteCategory,
    getCategory,
    // 题目相关
    getSubject,
    deleteSubject,
    updateSubject,
    addSubject,
    // 答题记录
    getUserAnswerRecord,
    // 答题排名
    getAnswerRank,
    // 趣味小知识
    getKnowledge,
    addKnowledge,
    deleteKnowledge,
    editKnowledge   
}